import request from '@/utils/Request'

// 查询渠道列表
export function listChannel(query: any) {
    return request({
        url: '/channel/fetch',
        method: 'get',
        params: query
    })
}

// 查询渠道详细信息
export function getChannel(id: string) {
    return request({
        url: `/channel/get/${id}`,
        method: 'get',
    })
}

// 新增渠道
export function saveChannel(data: any) {
    return request({
        url: '/channel/save',
        method: 'post',
        data: data
    })
}

// 修改渠道
export function updateChannel(data: any) {
    return request({
        url: '/channel/update',
        method: 'put',
        data: data
    })
}

// 删除渠道
export function delChannel(ids: any) {
    return request({
        url: '/channel/delete',
        method: 'delete',
        data: {
            listIds: ids instanceof Array ? ids : [ids]
        }
    })
}